<template>
	<view class="img-cont">
		<rich-text :nodes="nodes"></rich-text>
	</view>
</template>

<script>
	import { frontDetail } from '@/api/product.js'
	export default {
		data() {
			return {
				nodes: '',
				// imgPath: 'https://exp-picture.cdn.bcebos.com/2a1ecb460596b814e9fce0b043d246fe464e2283.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1%2Fquality%2Cq_80'
			}
		},
		onLoad(option) {
			if (option.productId) {
				this.getData(option.productId)
			}
		},
		methods: {
			getData(id){
				frontDetail({productId: id}).then(respanse => {
					const {detail, store, type} = respanse.result
					if (detail) {
						this.nodes = detail.replace(/\<img/gi, '<img style="max-width: 100% !important;height: auto!important;display: block!important"')
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	// .img-cont {
	// 	width: 100%;
	// 	overflow: hidden;
	// }
	// .img {
	// 	width: 100%;
	// 	display: block;
	// }
</style>
